class_name TestMoveNode
extends BehaviorTreeNode

var display_name: String
var control_node: Node2D
var direction: Vector2
var target: Vector2


func _on_enter():
    print("enter: ", display_name, control_node.name)


func _on_exit():
    print("exit: ", display_name, control_node.name)


func _tick(delta: float) -> NodeState:

    if control_node.position.distance_to(target) < 1.0:
        print("tick success: ", display_name, control_node.position)
        return NodeState.SUCCESS

    control_node.position += direction * delta * 100
    return NodeState.RUNNING
